package com.itheima.reggie.mapper;

import com.itheima.reggie.dto.OrdersDto;
import com.itheima.reggie.entity.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderMapper {


    @Insert("INSERT INTO orders VALUES (#{id},#{number},#{status},#{userId},#{addressBookId},#{orderTime},#{checkoutTime},#{payMethod},#{amount},#{remark},#{phone},#{address},#{userName},#{consignee})")
    void save(Orders orders);


    List<Orders> findByNumberAndTime(@Param("number") String number, @Param("beginTime") String beginTime, @Param("endTime") String endTime);
    @Select("SELECT * FROM orders")
    List<OrdersDto> findById(Integer page, Integer pageSize);
}
